import AsyncComponent from './asyncRoute';
// import permissionRoute from './permissionRoute';
import commonRoute from './commonRoute';

const route = [
  // ...permissionRoute,
  {
    path: '/dashboard',
    name: 'dashboard',
    label: '主页',
    icon: 'HomeOutlined',
    meta: {
      requiresAuth: true, // 是否需要登录，true: 登录后才能看到
    },
    component: AsyncComponent(() => import('@V/dashboard')),
  },
  {
    path: '/page',
    name: 'page',
    label: '测试路由页面',
    icon: 'LoginOutlined',
    meta: { requiresAuth: true, },
    routes: [
      {
        path: '/page/one',
        name: 'page/one',
        label: '二级路由',
        meta: { requiresAuth: true, },
        component: AsyncComponent(() => import('@V/page')),
      },
      {
        path: '/page/404',
        name: 'page/404',
        label: '404',
        meta: { requiresAuth: false, },
        component: AsyncComponent(() => import('@V/unexpected')),
      },
      {
        label: '测试路由页面2',
        meta: { requiresAuth: true, },
        routes: [
          {
            path: '/page/one/two',
            name: 'page/one/two',
            label: '三级路由',
            meta: { requiresAuth: true, },
            component: AsyncComponent(() => import('@V/page/page2')),
          }
        ]
      }
    ],
  },
  {
    path: '/operateText',
    name: 'operateText',
    label: '文字操作',
    icon: 'EditOutlined',
    meta: { requiresAuth: true, },
    component: AsyncComponent(() => import('@V/operateText')),
  },
  {
    path: '/purchaseOrder',
    name: 'purchaseOrder',
    label: '进货单',
    icon: 'BarChartOutlined',
    meta: { requiresAuth: true, },
    component: AsyncComponent(() => import('@V/purchaseOrder')),
  },
  ...commonRoute,
];

export default route;
